package com.server.questionbank.snframe.util.FileUtil;

import org.springframework.web.multipart.MultipartFile;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;

/**
 * 空的MultipartFile实现，用于创建文件夹
 */
public class EmptyMultipartFile implements MultipartFile {
    private final String name;
    
    public EmptyMultipartFile(String name) {
        this.name = name;
    }

    @Override
    public String getName() { return name; }
    
    @Override
    public String getOriginalFilename() { return ".keep"; }
    
    @Override
    public String getContentType() { return "application/octet-stream"; }
    
    @Override
    public boolean isEmpty() { return true; }
    
    @Override
    public long getSize() { return 0L; }
    
    @Override
    public byte[] getBytes() { return new byte[0]; }
    
    @Override
    public InputStream getInputStream() { return new ByteArrayInputStream(new byte[0]); }
    
    @Override
    public void transferTo(File dest) { }
} 